<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>添加图书</title>
    <style>
        body {
            margin: 0;
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
            color: #f0f0f0;
        }

        h1 {
            text-align: center;
            margin-top: 40px;
            font-size: 2.5em;
            color: #00ffff;
            text-shadow: 0 0 10px #00ffff;
        }

        nav {
            text-align: center;
            margin-bottom: 30px;
        }

        nav a {
            color: #00ffff;
            text-decoration: none;
            margin: 0 10px;
            font-weight: bold;
            transition: color 0.3s;
        }

        nav a:hover {
            color: #ffffff;
        }

        form {
            background: rgba(255, 255, 255, 0.05);
            max-width: 600px;
            margin: auto;
            padding: 30px 40px;
            border-radius: 16px;
            box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
            backdrop-filter: blur(8px);
        }

        form p {
            margin-bottom: 20px;
        }

        input[type="text"],
        input[type="date"],
        select,
        textarea {
            width: 100%;
            padding: 10px;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            border-radius: 8px;
            color: #fff;
            font-size: 1em;
            box-shadow: inset 0 0 5px rgba(0, 255, 255, 0.1);
        }

        input[type="text"]:focus,
        input[type="date"]:focus,
        select:focus,
        textarea:focus {
            outline: none;
            background: rgba(0, 255, 255, 0.1);
            box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
        }

        textarea {
            resize: vertical;
            min-height: 100px;
        }

        input[type="submit"] {
            width: 100%;
            padding: 12px;
            background: linear-gradient(90deg, #00c9ff, #92fe9d);
            border: none;
            border-radius: 8px;
            color: #000;
            font-size: 1.2em;
            font-weight: bold;
            cursor: pointer;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        input[type="submit"]:hover {
            transform: scale(1.03);
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
        }

        @media (max-width: 600px) {
            form {
                padding: 20px;
            }
        }
    </style>
</head>
<body>
    <h1>添加图书</h1>
    <nav>
        <a href="/books">图书管理</a> |
        <a href="/">首页</a>
    </nav>
    <form action="/books/add" method="post">
        <p>标题: <input type="text" name="title" required></p>
        <p>作者: <input type="text" name="author" required></p>
        <p>出版社: <input type="text" name="publisher"></p>
        <p>分类:
            <select name="category_id">
                {{range .Categories}}
                <option value="{{.ID}}">{{.Name}}</option>
                {{end}}
            </select>
        </p>
        <p>出版日期: <input type="date" name="published_at"></p>
        <p>描述: <textarea name="description"></textarea></p>
        <p><input type="submit" value="添加"></p>
    </form>
</body>
</html>
